import React from 'react';

export default class Mask extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            show: this.props.show || false
        };
        this.handleClick = this.handleClick.bind(this)
    };
    handleClick(){
        this.setState({
            show: !this.state.show
        });
        this.props.onShift();
    }
    render(){
        if(this.state.show){
           let style = {
                position: 'fixed',
                zIndex: 5,
                left: 0,
                top: 0,
                width: '100%',
                height: window.innerHeight,
                backgroundColor: '#000',
                opacity: 0.3
            };
            return (<div onClick={this.handleClick} style={style}>mask</div>)
        }else{
           return (<div></div>)
        }
    }
}